package com.qmds.deviceserver.type.controller;

import com.qmds.common.core.entity.ProductType;
import com.qmds.common.core.vo.R;
import com.qmds.deviceserver.type.param.ProductTypeAddParam;
import com.qmds.deviceserver.type.service.ProductTypeService;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.List;

/**
 * --- 代码敲烂 月薪过万 ---
 *
 * @author ShiJiaWei
 * @date 2024/9/9
 * @desc:
 */
@RestController
@RequestMapping("/app/device")
public class ProductTypeController {

    @Resource
    private ProductTypeService productTypeService;

    @GetMapping("/product/type/all")
    public R<List<ProductType>> findAll() {
        return productTypeService.findAll();
    }

    @PostMapping("/product/type/add")
    public R<Integer> addProductType(@RequestBody ProductTypeAddParam typeParam) {
        return productTypeService.addProductType(typeParam);
    }
}
